- if current_user
  - can_edit = can?(current_user, :admin_group, @group)
  - member = @group.members.find_by(user_id: current_user.id)
  - can_leave = member && can?(current_user, :destroy_group_member, member)

  .controls
    .dropdown.group-settings-dropdown
      %a.dropdown-new.btn.btn-default#group-settings-button{href: '#', 'data-toggle' => 'dropdown'}
        = icon('cog')
        = icon('caret-down')
      %ul.dropdown-menu.dropdown-menu-align-right
        = nav_link(path: 'groups#projects') do
          = link_to '项目', projects_group_path(@group), title: '项目'
        %li.divider
        - if can_edit
          %li
            = link_to '编辑群组', edit_group_path(@group)
        - if can_leave
          %li
            = link_to polymorphic_path([:leave, @group, :members]),
              data: { confirm: leave_confirmation_message(@group) }, method: :delete, title: '离开群组' do
              离开群组
